<?php
/**
 * Zend Framework (http://framework.zend.com/)
 *
 * @link      http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
 * @license   http://framework.zend.com/license/new-bsd New BSD License
 */
//define('LANGUE', $cookie->getValue());
$user_session = new Zend\Session\Container('user');

if ($user_session->language =='' || $user_session->language == null){
	
	$user_session->language = 'fr_FR';
}

return array(
    'router' => array(
        'routes' => array(
            'home' => array(
                'type' => 'Zend\Mvc\Router\Http\Literal',
                'options' => array(
                    'route'    => '/',
                    'defaults' => array(
                        'controller' => 'Application\Controller\Index',
                        'action'     => 'index',
                    ),
                ),
            ),
       		
        	'abonnement' => array(
        			'type' => 'Zend\Mvc\Router\Http\Literal',
        			'options' => array(
        					'route'    => '/abonnement',
        					'defaults' => array(
        							'controller' => 'Application\Controller\Abonnement',
        							'action'     => 'abonnement',
        					),
        			),
        	),
        	

        	'intranet' => array(
        				'type'    => 'Literal',
        				'options' => array(
        						'route'    => '/intranet',
        						'defaults' => array(
        								'__NAMESPACE__' => 'Application\Controller',
        								'controller'    => 'Intranet',
        								'action'        => 'intranet',
        						),
        				),
        				'may_terminate' => true,
        		
        				'child_routes' => array(
        						'default' => array(
        								'type'    => 'Segment',
        								'options' => array(
        										'route'    => '/[:controller[/:action/page/:page]]',
        										'constraints' => array(
        												'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
        												'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
        										),
        										
        										'defaults' => array(
        												'page' => 1,
        										),
        								),
        						),
        				),
        		),
        		
        		
        		
        		'francais' => array(
        				'type' => 'Zend\Mvc\Router\Http\Literal',
        				'options' => array(
        						'route'    => '/changetoFrench',
        						'defaults' => array(
        								'controller' => 'Application\Controller\ChangelanguageController',
        								'action'     => 'changetoFrench',
        						),
        				),
        		),
        	
        	'presentation' => array(
        			'type' => 'Zend\Mvc\Router\Http\Literal',
        			'options' => array(
        					'route'    => '/presentation',
        					'defaults' => array(
        							'controller' => 'Application\Controller\Presentation',
        							'action'     => 'presentation',
        					),
        			),
        	),
        		'service' => array(
        				'type' => 'Zend\Mvc\Router\Http\Literal',
        				'options' => array(
        						'route'    => '/services',
        						'defaults' => array(
        								'controller' => 'Application\Controller\Services',
        								'action'     => 'services',
        						),
        				),
        		),
        		
        		'apropos' => array(
        				'type' => 'Zend\Mvc\Router\Http\Literal',
        				'options' => array(
        						'route'    => '/apropos',
        						'defaults' => array(
        								'controller' => 'Application\Controller\Apropos',
        								'action'     => 'apropos',
        						),
        				),
        		),
        		
        		'actualite' => array(
        				'type' => 'Zend\Mvc\Router\Http\Literal',
        				'options' => array(
        						'route'    => '/actualite',
        						'defaults' => array(
        								'controller' => 'Application\Controller\Actualite',
        								'action'     => 'actualite',
        						),
        				),
        		),
        		
        		'produit' => array(
        				'type' => 'Zend\Mvc\Router\Http\Literal',
        				'options' => array(
        						'route'    => '/produits',
        						'defaults' => array(
        								'controller' => 'Application\Controller\Produits',
        								'action'     => 'produits',
        						),
        				),
        		),
        		
        		
        		'contact' => array(
        				'type'    => 'Literal',
        				'options' => array(
        						'route'    => '/contact',
        						'defaults' => array(
        								'__NAMESPACE__' => 'Application\Controller',
        								'controller'    => 'Contact',
        								'action'        => 'contact',
        						),
        				),
        				'may_terminate' => true,
        		
        				'child_routes' => array(
        						'default' => array(
        								'type'    => 'Segment',
        								'options' => array(
        										'route'    => '/[:controller[/:action]]',
        										'constraints' => array(
        												'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
        												'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
        										),
        										'defaults' => array(
        										),
        								),
        						),
        				),
        		),
        		
        		'servicesadministratifs' => array(
        				'type'    => 'Literal',
        				'options' => array(
        						'route'    => '/services_administratifs',
        						'defaults' => array(
        								'__NAMESPACE__' => 'Application\Controller',
        								'controller'    => 'Servicesadministratifs',
        								'action'        => 'servicesadministratifs',
        						),
        				),
        				'may_terminate' => true,
        		
        				'child_routes' => array(
        						'default' => array(
        								'type'    => 'Segment',
        								'options' => array(
        										'route'    => '/[:controller[/:action]]',
        										'constraints' => array(
        												'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
        												'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
        										),
        										'defaults' => array(
        										),
        								),
        						),
        				),
        		),
        		
				'commande' => array(
					'type'    => 'Literal',
					'options' => array(
							'route'    => '/application/servicesadministratifs/commande',
							'defaults' => array(
									'__NAMESPACE__' => 'Application\Controller',
									'controller'    => 'Servicesadministratifs',
									'action'        => 'commande',
        						),
        				),
        				'may_terminate' => true,
        		
        				'child_routes' => array(
        						'default' => array(
        								'type'    => 'Segment',
        								'options' => array(
        										'route'    => '/[:controller[/:action]]',
        										'constraints' => array(
        												'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
        												'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
        										),
        										'defaults' => array(
        										),
        								),
        						),
        				),
        		),
				
        		'changelanguage' => array(
        				'type'    => 'Literal',
        				'options' => array(
        						'route'    => '/changelanguage',
        						'defaults' => array(
        								'__NAMESPACE__' => 'Application\Controller',
        								'controller'    => 'Changelanguage',
        								'action'        => 'changelanguage',
        						),
        				),
        				'may_terminate' => true,
        		
        				'child_routes' => array(
        						'default' => array(
        								'type'    => 'Segment',
        								'options' => array(
        										'route'    => '/[:controller[/:action]]',
        										'constraints' => array(
        												'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
        												'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
        										),
        										'defaults' => array(
        										),
        								),
        						),
        				),
        		),
        		
        	
        		'formation' => array(
        				'type'    => 'Literal',
        				'options' => array(
        						'route'    => '/formation',
        						'defaults' => array(
        								'__NAMESPACE__' => 'Application\Controller',
        								'controller'    => 'Formation',
        								'action'        => 'formation',
        						),
        				),
        				'may_terminate' => true,
        		
        				'child_routes' => array(
        						'default' => array(
        								'type'    => 'Segment',
        								'options' => array(
        										'route'    => '/[:controller[/:action]]',
        										'constraints' => array(
        												'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
        												'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
        										),
        										'defaults' => array(
        										),
        								),
        						),
        				),
        		),
        		
        		

        		'mylamisa' => array(
        				'type'    => 'Literal',
        				'options' => array(
        						'route'    => '/MyLamisa',
        						'defaults' => array(
        								'__NAMESPACE__' => 'Application\Controller',
        								'controller'    => 'Mylamisa',
        								'action'        => 'mylamisa',
        						),
        				),
        				'may_terminate' => true,
        		
        				'child_routes' => array(
        						'default' => array(
        								'type'    => 'Segment',
        								'options' => array(
        										'route'    => '/[:controller[/:action]]',
        										'constraints' => array(
        												'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
        												'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
        										),
        										'defaults' => array(
        										),
        								),
        						),
        				),
        		),
        		
        		
        		'espaceclient' => array(
        				'type'    => 'Literal',
        				'options' => array(
        						'route'    => '/espace_client',
        						'defaults' => array(
        								'__NAMESPACE__' => 'Application\Controller',
        								'controller'    => 'Espaceclient',
        								'action'        => 'espaceclient',
        						),
        				),
        				'may_terminate' => true,
        		
        				'child_routes' => array(
        						'default' => array(
        								'type'    => 'Segment',
        								'options' => array(
        										'route'    => '/[:controller[/:action]]',
        										'constraints' => array(
        												'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
        												'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
        										),
        										'defaults' => array(
        										),
        								),
        						),
        				),
        		),
        		
        		'connexion' => array(
        				'type'    => 'Literal',
        				'options' => array(
        						'route'    => '/application/intranet/connexion',
        						'defaults' => array(
        								'__NAMESPACE__' => 'Application\Controller',
        								'controller'    => 'Intranet',
        								'action'        => 'connexion',
        						),
        				),
        				'may_terminate' => true,
        		
        				'child_routes' => array(
        						'default' => array(
        								'type'    => 'Segment',
        								'options' => array(
        										'route'    => '/[:controller[/:action]]',
        										'constraints' => array(
        												'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
        												'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
        										),
        										'defaults' => array(
        										),
        								),
        						),
        				),
        		),

        		'connexion_client' => array(
        				'type'    => 'Literal',
        				'options' => array(
        						'route'    => '/application/espaceclient/connexion',
        						'defaults' => array(
        								'__NAMESPACE__' => 'Application\Controller',
        								'controller'    => 'Espaceclient',
        								'action'        => 'connexion',
        						),
        				),
        				'may_terminate' => true,
        		
        				'child_routes' => array(
        						'default' => array(
        								'type'    => 'Segment',
        								'options' => array(
        										'route'    => '/[:controller[/:action]]',
        										'constraints' => array(
        												'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
        												'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
        										),
        										'defaults' => array(
        										),
        								),
        						),
        				),
        		),
        		
        		
        		'downloadfile' => array(
        				'type'    => 'Literal',
        				'options' => array(
        						'route'    => '/application/intranet/downloadfile',
        						'defaults' => array(
        								'__NAMESPACE__' => 'Application\Controller',
        								'controller'    => 'Intranet',
        								'action'        => 'downloadfile',
        						),
        				),
        				'may_terminate' => true,
        		
        				'child_routes' => array(
        						'default' => array(
        								'type'    => 'Segment',
        								'options' => array(
        										'route'    => '/[:controller[/:action]]',
        										'constraints' => array(
        												'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
        												'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
        										),
        										'defaults' => array(
        										),
        								),
        						),
        				),
        		),
        	
        		
        		'demande' => array(
        				'type'    => 'Literal',
        				'options' => array(
        						'route'    => '/application/intranet/demande',
        						'defaults' => array(
        								'__NAMESPACE__' => 'Application\Controller',
        								'controller'    => 'Intranet',
        								'action'        => 'demande',
        						),
        				),
        				'may_terminate' => true,
        		
        				'child_routes' => array(
        						'default' => array(
        								'type'    => 'Segment',
        								'options' => array(
        										'route'    => '/[:controller[/:action]]',
        										'constraints' => array(
        												'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
        												'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
        										),
        										'defaults' => array(
        										),
        								),
        						),
        				),
        		),
        		
        		
        		
        		'inscription' => array(
        				'type'    => 'Literal',
        				'options' => array(
        						'route'    => '/application/espaceclient/inscription',
        						'defaults' => array(
        								'__NAMESPACE__' => 'Application\Controller',
        								'controller'    => 'Espaceclient',
        								'action'        => 'inscription',
        						),
        				),
        				'may_terminate' => true,
        		
        				'child_routes' => array(
        						'default' => array(
        								'type'    => 'Segment',
        								'options' => array(
        										'route'    => '/[:controller[/:action]]',
        										'constraints' => array(
        												'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
        												'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
        										),
        										'defaults' => array(
        										),
        								),
        						),
        				),
        		),
        		
        		
        		'inscription_personnel' => array(
        				'type'    => 'Literal',
        				'options' => array(
        						'route'    => '/application/intranet/inscription',
        						'defaults' => array(
        								'__NAMESPACE__' => 'Application\Controller',
        								'controller'    => 'Intranet',
        								'action'        => 'inscription',
        						),
        				),
        				'may_terminate' => true,
        		
        				'child_routes' => array(
        						'default' => array(
        								'type'    => 'Segment',
        								'options' => array(
        										'route'    => '/[:controller[/:action]]',
        										'constraints' => array(
        												'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
        												'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
        										),
        										'defaults' => array(
        										),
        								),
        						),
        				),
        		),
        	
        		

        		
        		// connection
        		
        		'login' => array(
        				'type'    => 'Literal',
        				'options' => array(
        						'route'    => '/auth',
        						'defaults' => array(
        								'__NAMESPACE__' => 'Application\Controller',
        								'controller'    => 'Auth',
        								'action'        => 'login',
        						),
        				),
        				'may_terminate' => true,
        				'child_routes' => array(
        						'process' => array(
        								'type'    => 'Segment',
        								'options' => array(
        										'route'    => '/[:action]',
        										'constraints' => array(
        												'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
        												'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
        										),
        										'defaults' => array(
        										),
        								),
        						),
        				),
        		),
        		
        		//Administration
        		
        	/*	'admin' => array(
        				'type' => 'Zend\Mvc\Router\Http\Literal',
        				'options' => array(
        						'route'    => '/admin',
        						'defaults' => array(
        								'controller' => 'Application\Controller\Admin',
        								'action'     => 'admin',
        						),
        				),
        		),
        		
        		*/
        	
        		'admin' => array(
        				'type'    => 'Literal',
        				'options' => array(
        						'route'    => '/admin',
        						'defaults' => array(
        								'__NAMESPACE__' => 'Application\Controller',
        								'controller'    => 'Admin',
        								'action'        => 'admin',
        						),
        				),
        				'may_terminate' => true,
        				'child_routes' => array(
        						'process' => array(
        								'type'    => 'Segment',
        								'options' => array(
        										'route'    => '/[:action]',
        										'constraints' => array(
        												'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
        												'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
        										),
        										'defaults' => array(
        										),
        								),
        						),
        				),
        		),
        		
            // The following is a route to simplify getting started creating
            // new controllers and actions without needing to create a new
            // module. Simply drop new controllers in, and you can access them
            // using the path /application/:controller/:action
            'application' => array(
                'type'    => 'Literal',
                'options' => array(
                    'route'    => '/application',
                    'defaults' => array(
                        '__NAMESPACE__' => 'Application\Controller',
                        'controller'    => 'Index',
                        'action'        => 'index',
                    ),
                ),
                'may_terminate' => true,
                
                'child_routes' => array(
                    'default' => array(
                        'type'    => 'Segment',
                        'options' => array(
                            'route'    => '/[:controller[/:action]]',
                            'constraints' => array(
                                'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
                                'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
                            ),
                            'defaults' => array(
                            ),
                        ),
                    ),
                ),
            ),
            
        ),
    ),
    'service_manager' => array(
        'abstract_factories' => array(
            'Zend\Cache\Service\StorageCacheAbstractServiceFactory',
            'Zend\Log\LoggerAbstractServiceFactory',
        	
        ),
        'aliases' => array(
            'translator' => 'MvcTranslator',
        ),
    ),
    'translator' => array(
        'locale' => $user_session->language,
        'translation_file_patterns' => array(
            array(
                'type'     => 'gettext',
                'base_dir' => __DIR__ . '/../language',
                'pattern'  => '%s.mo',
            ),
        ),
    ),
    
    
    'controllers' => array(
        'invokables' => array(
       		 'User\Controller\User' => 'User\Controller\UserController',
           	 'Application\Controller\Index'      => 'Application\Controller\IndexController',
           	 'Application\Controller\Services'   => 'Application\Controller\ServicesController',
           	 'Application\Controller\Produits'   => 'Application\Controller\ProduitsController',
           	 'Application\Controller\Contact'  	 => 'Application\Controller\ContactController',
           	 'Application\Controller\Apropos' 	 => 'Application\Controller\AproposController',
           	 'Application\Controller\Actualite'  => 'Application\Controller\ActualiteController',
           	 'Application\Controller\Intranet'   => 'Application\Controller\IntranetController',
           	 'Application\Controller\Presentation'   => 'Application\Controller\PresentationController',
           	 'Application\Controller\Changelanguage'  => 'Application\Controller\ChangelanguageController',
        	 'Application\Controller\Servicesadministratifs'  	 => 'Application\Controller\ServicesadministratifsController',
        	 'Application\Controller\Formation'  	 => 'Application\Controller\FormationController',
        	 'Application\Controller\Espaceclient'  	 => 'Application\Controller\EspaceclientController',
        	 'Application\Controller\Admin'  	 => 'Application\Controller\AdminController',
        	// 'Application\Controller\Mylamisa'  	 => 'Application\Controller\MylamisaController',
        	 'Application\Controller\Mylamisa'  	 => 'Application\Controller\MylamisaController',
        	 'Application\Controller\Abonnement'  	 => 'Application\Controller\AbonnementController',
        	 'Application\Controller\Auth'  	 => 'Application\Controller\AuthController',
        	 'Application\Controller\Success'  	 => 'Application\Controller\SuccessController',
        ),
        
    ),
    'view_manager' => array(
        'display_not_found_reason' => true,
        'display_exceptions'       => true,
        'doctype'                  => 'HTML5',
        'not_found_template'       => 'error/404',
    	'forbidden'                => 'error/403',
        'exception_template'       => 'error/index',
        'template_map' => array(
            'layout/layout'           => __DIR__ . '/../view/layout/layout.phtml',
          //  'application/index/index' => __DIR__ . '/../view/application/index/index.phtml',
            'error/404'               => __DIR__ . '/../view/error/404.phtml',
        	'error/403'               => __DIR__ . '/../view/error/403.phtml',
            'error/index'             => __DIR__ . '/../view/error/index.phtml',
           // 'application/index/abonnement'  => __DIR__ . '/../view/application/index/index.phtml',
            'application/contact/message_envoye'             => __DIR__ . '/../view/Application/contact/message_envoye.phtml',
        	'application/intranet/demande' 					 => __DIR__ . '/../view/Application/intranet/intranet.phtml',
        		
        ),
        'template_path_stack' => array(
            __DIR__ . '/../view',
        ),
    ),
    // Placeholder for console routes
    'console' => array(
        'router' => array(
            'routes' => array(
            ),
        ),
    ),
    

			
	
 
    		'session' => array(
    				'remember_me_seconds'  => 1200,
    				'use_cookies'          => true,
    				'cookie_httponly'      => true,
    				//'mail_send' 		    =>true,
    				//'cookie_domain'        => 'aromatix.fr',
    		),
 
  
);
